{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "37910568e0b13d19",
   "metadata": {
    "collapsed": false
   },
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "98770b8895050622",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## 【实验8-1】调用requests库和BeautifulSoup库，使用BeautifulSoup库爬取计科院网站首页动态新闻\n",
    "爬取目标网址：https://www.swpu.edu.cn/scs/\n",
    "调用requests库和BeautifulSoup库，西南石油大学计算机科学学院首页的爬取路径为：\n",
    "path='https://www.swpu.edu.cn/scs/index.htm' \n",
    "相关注释如下：\n",
    "> 调用requests库 \n",
    "> 调用BeautifulSoup库\n",
    "> 返回一个response对象，赋值给res \n",
    "> 把res的内容以字符串的形式返回 \n",
    "> 把网页解析为BeautifulSoup对象 \n",
    "> 通过定位标签和属性提取我们想要的数据  \n",
    "> 打印输出爬取结果"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1f5db694dd39aa69",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "通过以下PowerShell使用pip安装requests和BeautifulSoup库。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "2efae641a134d88b",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-05-05T09:56:44.413228200Z",
     "start_time": "2024-05-05T09:56:42.978920900Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple/\n",
      "Requirement already satisfied: requests in f:\\pythonproject\\py_web_programme\\beautiful_soup\\venv\\lib\\site-packages (2.31.0)\n",
      "Requirement already satisfied: beautifulsoup4 in f:\\pythonproject\\py_web_programme\\beautiful_soup\\venv\\lib\\site-packages (4.12.3)\n",
      "Requirement already satisfied: certifi>=2017.4.17 in f:\\pythonproject\\py_web_programme\\beautiful_soup\\venv\\lib\\site-packages (from requests) (2024.2.2)\n",
      "Requirement already satisfied: idna<4,>=2.5 in f:\\pythonproject\\py_web_programme\\beautiful_soup\\venv\\lib\\site-packages (from requests) (3.7)\n",
      "Requirement already satisfied: urllib3<3,>=1.21.1 in f:\\pythonproject\\py_web_programme\\beautiful_soup\\venv\\lib\\site-packages (from requests) (2.2.1)\n",
      "Requirement already satisfied: charset-normalizer<4,>=2 in f:\\pythonproject\\py_web_programme\\beautiful_soup\\venv\\lib\\site-packages (from requests) (3.3.2)\n",
      "Requirement already satisfied: soupsieve>1.2 in f:\\pythonproject\\py_web_programme\\beautiful_soup\\venv\\lib\\site-packages (from beautifulsoup4) (2.5)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "[notice] A new release of pip available: 22.3.1 -> 24.0\n",
      "[notice] To update, run: python.exe -m pip install --upgrade pip\n"
     ]
    }
   ],
   "source": [
    "!powershell pip install requests beautifulsoup4 -i https://pypi.mirrors.ustc.edu.cn/simple/"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "id": "177354b842233375",
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-05-05T14:45:12.771393300Z",
     "start_time": "2024-05-05T14:45:12.653375500Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[04-24]天津科技大学人工智能学院来我院调研\n",
      "[04-22]学院党委开展“追忆革命先烈，赓续红色血脉\n",
      "[04-22]赵刚同志任计算机与软件学院院长、党委副书\n",
      "[04-17]计算机与软件学院召开2024届毕业生就业工作\n",
      "[04-16]我院学生团队斩获ASC世界大学生超级计算机\n",
      "[04-15]马克思主义学院来计算机与软件学院调研虚拟\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "url = 'https://www.swpu.edu.cn/scs/index.htm'\n",
    "res = requests.get(url)\n",
    "res.encoding = res.apparent_encoding\n",
    "html_content = res.text\n",
    "soup = BeautifulSoup(html_content, 'html.parser',from_encoding='utf-8')\n",
    "# 定位包含动态新闻的<ul>标签\n",
    "ul_tag = soup.find('ul', class_='dynamic_list')\n",
    "\n",
    "# 如果找到了<ul>标签\n",
    "if ul_tag:\n",
    "    # 遍历<ul>下的每一个<li>标签\n",
    "    for li_tag in ul_tag.find_all('li'):\n",
    "        # 在每个<li>标签中，遍历每一个<a>标签\n",
    "        for a_tag in li_tag.find_all('a'):\n",
    "            s:str=a_tag.text\n",
    "            print(s)\n",
    "else:\n",
    "    print(\"未找到动态新闻列表\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e63c09d107c607ec",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "【实验8-2】调用requests库和os库（创建文件夹），在网上爬取一个图片文件并使用保存在本地D盘picture文件夹中。如果文件不存在，就创建并保存，如果文件存在，就提示已经存在，如果爬取不成功，就提示爬取失败。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "id": "e1fd4a19a3e2338",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-05-05T14:12:10.319032800Z",
     "start_time": "2024-05-05T14:12:10.230022100Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "图片保存成功\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "import requests\n",
    "\n",
    "# 图片保存路径\n",
    "save_dir = 'D:/picture'\n",
    "\n",
    "if not os.path.exists(save_dir):\n",
    "    os.makedirs(save_dir)\n",
    "\n",
    "image_url = 'https://www.swpu.edu.cn/scs/img/welcome.jpg'\n",
    "\n",
    "filename = os.path.join(save_dir, '爬取到的图片.jpg')\n",
    "\n",
    "if os.path.exists(filename):\n",
    "    print(\"图片已存在\")\n",
    "else:\n",
    "    try:\n",
    "        response = requests.get(image_url)\n",
    "        if response.status_code == 200:\n",
    "            with open(filename, 'wb') as f:\n",
    "                f.write(response.content)\n",
    "            print(\"图片保存成功\")\n",
    "        else:\n",
    "            print(\"爬取失败，状态码：\", response.status_code)\n",
    "    except Exception as e:\n",
    "        print(\"爬取失败：\", e)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a57d8d92ba5646cb",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "【实验8-3】目标：从下厨房网站爬取本周热门菜谱清单（菜品名称、网址、食材构成）\n",
    "爬取目标网址：http://www.xiachufang.com\n",
    "(1)阅读网站Robots协议：http://www.xiachufang.com/robots.txt 识别Disallow和Allow: /category/*/?ref=*\n",
    "    已阅读，explore可以爬取。\n",
    "(2)计划爬取到的信息：菜名、食材、食材对应的详细页URL\n",
    "(3)锁定目标、分析HTML结构、查找信息\n",
    "(4)代码实现过程如下：\n",
    "Step 1. 选取的URL是： http://www.xiachufang.com/explore/ 用requests.get()来获取数据。\n",
    "Step 2. 使用BeautifulSoup来解析\n",
    "Step 3. 提取最小父级标签。它的标签是<div>，有一个class属性，其值是info pure-u。可以使用find_all()语法，来找到它们。\n",
    "Step 4. 不先急于提取出所有的菜名、URL和食材。先尝试提取一组，等成功了，再去写循环提取所有。\n",
    "Step 5. 写循环存列表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "7e7dcf6b80be805e",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-05-05T14:12:03.335628200Z",
     "start_time": "2024-05-05T14:12:02.678158900Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "菜名: 万能的“拌面，水饺🥟”调料\n",
      "食材: 蒜末、盐、蚝油、香油、葱、鸡精、生抽、糖\n",
      "详情页URL: http://www.xiachufang.com/recipe/107312845/\n",
      "\n",
      "\n",
      "菜名: 超开胃的番茄土豆肥牛汤‼️下米饭无敌了\n",
      "食材: 土豆、番茄、肥牛、大蒜、小葱\n",
      "详情页URL: http://www.xiachufang.com/recipe/105910837/\n",
      "\n",
      "\n",
      "菜名: ❗拿肉都不换的手撕包菜，5分钟快手家常菜🔥\n",
      "食材: 包菜、大蒜、干辣椒\n",
      "详情页URL: http://www.xiachufang.com/recipe/106397717/\n",
      "\n",
      "\n",
      "菜名: 比布丁还要嫩，老少皆宜的肉沫蒸蛋\n",
      "食材: 鸡蛋、肉沫、葱花、蚝油、生抽、盐、淀粉水\n",
      "详情页URL: http://www.xiachufang.com/recipe/106781050/\n",
      "\n",
      "\n",
      "菜名: 芒果脆皮雪糕丨锁死这个配方\n",
      "食材: 芒果肉、原味酸奶、淡奶油、糖、梦龙脆皮、黑巧克力、花生碎、椰子油\n",
      "详情页URL: http://www.xiachufang.com/recipe/107136340/\n",
      "\n",
      "\n",
      "菜名: 青椒火腿炒鸡蛋\n",
      "食材: 青椒、火腿肠、鸡蛋、蒜末、生抽、蚝油\n",
      "详情页URL: http://www.xiachufang.com/recipe/106886517/\n",
      "\n",
      "\n",
      "菜名: ‼️比辣条还好吃百倍〰️香辣豆皮✅零厨艺\n",
      "食材: 千张（豆皮）、小米椒、、葱花、香菜、生抽、香醋、蚝油、盐糖\n",
      "详情页URL: http://www.xiachufang.com/recipe/106030102/\n",
      "\n",
      "\n",
      "菜名: 童年最爱.奶油小布丁\n",
      "食材: 牛奶、淡奶油、细砂糖、奶粉、玉米淀粉\n",
      "详情页URL: http://www.xiachufang.com/recipe/107127593/\n",
      "\n",
      "\n",
      "菜名: 1分钟搞定好喝燕麦奶昔！减脂掉秤|低卡饱腹！\n",
      "食材: 即食燕麦、牛奶、水果\n",
      "详情页URL: http://www.xiachufang.com/recipe/106903165/\n",
      "\n",
      "\n",
      "菜名: 糖醋排骨（试验多次的最佳口感）\n",
      "食材: 排骨、醋、冰糖/白糖、料酒、生抽、老抽、大料、白芝麻、淀粉加水\n",
      "详情页URL: http://www.xiachufang.com/recipe/105979376/\n",
      "\n",
      "\n",
      "菜名: 吃了十几年的配方❗️每次做这至少吃2碗\n",
      "食材: 面条、番茄、肉末、葱姜\n",
      "详情页URL: http://www.xiachufang.com/recipe/107044155/\n",
      "\n",
      "\n",
      "菜名: 好吃到上头的日式肥牛饭✅一吃就爱上\n",
      "食材: 肥牛卷、洋葱、鸡蛋、生抽、老抽、蚝油、料酒、糖、盐、淀粉\n",
      "详情页URL: http://www.xiachufang.com/recipe/107186146/\n",
      "\n",
      "\n",
      "菜名: 蒜苔炒肉末，三碗米饭都不够吃\n",
      "食材: 蒜苔、肉末、小米辣、葱、蒜瓣\n",
      "详情页URL: http://www.xiachufang.com/recipe/106786587/\n",
      "\n",
      "\n",
      "菜名: 蒜香鸡翅｜孩子们的最爱\n",
      "食材: 鸡翅、蒜头、葱、白糖\n",
      "详情页URL: http://www.xiachufang.com/recipe/106928120/\n",
      "\n",
      "\n",
      "菜名: 生菜牛肉拌饭\n",
      "食材: 牛肉、生菜、鸡蛋、海苔碎、蒜、青红椒\n",
      "详情页URL: http://www.xiachufang.com/recipe/107148148/\n",
      "\n",
      "\n",
      "菜名: 夏日开胃小凉菜“皮蛋拌黄瓜🥒”开胃减脂\n",
      "食材: 黄瓜、小米椒、蒜末、生抽、醋、蚝油、糖\n",
      "详情页URL: http://www.xiachufang.com/recipe/107157495/\n",
      "\n",
      "\n",
      "菜名: 比外面卖的凉拌菜都好吃\n",
      "食材: 生抽、香油、蚝油、米醋、蒜瓣、小米辣、白芝麻\n",
      "详情页URL: http://www.xiachufang.com/recipe/106828623/\n",
      "\n",
      "\n",
      "菜名: 土法腌制100%出沙出油的五香咸鸭蛋\n",
      "食材: 鸭蛋、水、盐、高度白酒、桂皮、花椒、八角、香叶、白醋\n",
      "详情页URL: http://www.xiachufang.com/recipe/107284231/\n",
      "\n",
      "\n",
      "菜名: 豆豉蒸排骨，这个味太绝了！！\n",
      "食材: 排骨、豆豉、土豆、蒜瓣\n",
      "详情页URL: http://www.xiachufang.com/recipe/106804588/\n",
      "\n",
      "\n",
      "菜名: 外焦里嫩的香煎豆腐\n",
      "食材: 豆腐、蚝油、生抽、盐、厨邦鸡粉、白糖、清水、蒜末、小米辣、鸡蛋液、葱花、水淀粉\n",
      "详情页URL: http://www.xiachufang.com/recipe/106839961/\n",
      "\n",
      "\n",
      "菜名: 神仙配方肉包子     6个左右\n",
      "食材: ♥包子皮制作、面粉、猪油、温水、发酵粉、白糖、牛奶、♥肉馅制作、猪肉馅、盐、葱末、姜末、生抽、老抽、白糖、生面粉、白胡椒粉、热油、鸡精（或味精）、白开水\n",
      "详情页URL: http://www.xiachufang.com/recipe/104507319/\n",
      "\n",
      "\n",
      "菜名: 香辣孜然土豆火腿肠～秒杀烧烤店！！\n",
      "食材: 土豆、火腿肠、孜然烧烤粉、白芝麻、辣椒粉、生抽、盐、葱\n",
      "详情页URL: http://www.xiachufang.com/recipe/107237340/\n",
      "\n",
      "\n",
      "菜名: 清爽可口小凉菜\n",
      "食材: 黄瓜、花生米、腐竹\n",
      "详情页URL: http://www.xiachufang.com/recipe/107022052/\n",
      "\n",
      "\n",
      "菜名: 香甜无冰渣❗️自制草莓梦龙脆皮雪糕❗️\n",
      "食材: 🍓草莓雪糕、淡奶油、糖、草莓酱、牛奶、🍓白巧脆皮酱、白巧克力、椰子油、冻干草莓碎\n",
      "详情页URL: http://www.xiachufang.com/recipe/107328340/\n",
      "\n",
      "\n",
      "菜名: 豆腐抱蛋🥚(瘦身减脂餐)\n",
      "食材: 鸡蛋、内脂豆腐、葱花、生抽、蚝油、盐、味素、香油、水、食用油\n",
      "详情页URL: http://www.xiachufang.com/recipe/107262344/\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "from bs4 import BeautifulSoup\n",
    "\n",
    "# Step 1: 获取数据\n",
    "url = 'http://www.xiachufang.com/explore/'\n",
    "response = requests.get(url)\n",
    "html_content = response.text\n",
    "\n",
    "# Step 2: 使用BeautifulSoup解析\n",
    "soup:BeautifulSoup = BeautifulSoup(html_content, 'html.parser')\n",
    "\n",
    "# Step 3: 提取最小父级标签\n",
    "recipe_cards:[] = soup.find_all('div', class_='info pure-u')\n",
    "\n",
    "success:bool = False\n",
    "\n",
    "try:\n",
    "    # Step 4: 提取一组信息\n",
    "    recipe = recipe_cards[0]\n",
    "    success = True\n",
    "except:\n",
    "    print('提取信息失败')\n",
    "\n",
    "if success:\n",
    "    # Step 5: 循环提取所有信息\n",
    "    recipes_data = []\n",
    "    \n",
    "    for recipe in recipe_cards:\n",
    "        # 菜名\n",
    "        name = recipe.find('p', class_='name').text.strip()\n",
    "        \n",
    "        # 菜谱详情页URL\n",
    "        recipe_url = 'http://www.xiachufang.com' + recipe.find('p', class_='name').a['href']\n",
    "        \n",
    "        # 食材\n",
    "        ingredients = recipe.find('p', class_='ing ellipsis').text.strip()\n",
    "        \n",
    "        recipes_data.append({\n",
    "            'name': name,\n",
    "            'recipe_url': recipe_url,\n",
    "            'ingredients': ingredients\n",
    "        })\n",
    "    \n",
    "    # 打印结果\n",
    "    for recipe_data in recipes_data:\n",
    "        print(\"菜名:\", recipe_data['name'])\n",
    "        print(\"食材:\", recipe_data['ingredients'])\n",
    "        print(\"详情页URL:\", recipe_data['recipe_url'])\n",
    "        print(\"\\n\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "161157b4c29eaf7e",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "【实验8-4】目标：爬取豆瓣Top250电影的信息（包括：序号/电影名/评分/推荐语/链接）\n",
    "目标网址：https://movie.douban.com/top250\n",
    "采取的步骤如下：\n",
    "Step 1. 选取的URL是https://movie.douban.com/top250?start=0&filter=\n",
    "，用requests.get()来获取数据。\n",
    "Step 2. 使用BeautifulSoup来解析\n",
    "Step 3. 提取最小父级标签。它的标签是<div>，有一个class属性，其值是info pure-u。可以使用find_all()语法，来找到它们。\n",
    "Step 4. 不先急于提取出所有的信息。先尝试提取一组，等成功了，再去写循环提取所有。\n",
    "Step 5. 写循环存列表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "3035afc75bf9a283",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-05-05T14:12:23.408591Z",
     "start_time": "2024-05-05T14:12:19.280993300Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "序号: 1\n",
      "电影名称: 肖申克的救赎\n",
      "评分: 9.7\n",
      "推荐语: 希望让人自由。\n",
      "链接: https://movie.douban.com/subject/1292052/\n",
      "\n",
      "\n",
      "序号: 2\n",
      "电影名称: 霸王别姬\n",
      "评分: 9.6\n",
      "推荐语: 风华绝代。\n",
      "链接: https://movie.douban.com/subject/1291546/\n",
      "\n",
      "\n",
      "序号: 3\n",
      "电影名称: 阿甘正传\n",
      "评分: 9.5\n",
      "推荐语: 一部美国近现代史。\n",
      "链接: https://movie.douban.com/subject/1292720/\n",
      "\n",
      "\n",
      "序号: 4\n",
      "电影名称: 泰坦尼克号\n",
      "评分: 9.5\n",
      "推荐语: 失去的才是永恒的。\n",
      "链接: https://movie.douban.com/subject/1292722/\n",
      "\n",
      "\n",
      "序号: 5\n",
      "电影名称: 千与千寻\n",
      "评分: 9.4\n",
      "推荐语: 最好的宫崎骏，最好的久石让。\n",
      "链接: https://movie.douban.com/subject/1291561/\n",
      "\n",
      "\n",
      "序号: 6\n",
      "电影名称: 这个杀手不太冷\n",
      "评分: 9.4\n",
      "推荐语: 怪蜀黍和小萝莉不得不说的故事。\n",
      "链接: https://movie.douban.com/subject/1295644/\n",
      "\n",
      "\n",
      "序号: 7\n",
      "电影名称: 美丽人生\n",
      "评分: 9.5\n",
      "推荐语: 最美的谎言。\n",
      "链接: https://movie.douban.com/subject/1292063/\n",
      "\n",
      "\n",
      "序号: 8\n",
      "电影名称: 星际穿越\n",
      "评分: 9.4\n",
      "推荐语: 爱是一种力量，让我们超越时空感知它的存在。\n",
      "链接: https://movie.douban.com/subject/1889243/\n",
      "\n",
      "\n",
      "序号: 9\n",
      "电影名称: 盗梦空间\n",
      "评分: 9.4\n",
      "推荐语: 诺兰给了我们一场无法盗取的梦。\n",
      "链接: https://movie.douban.com/subject/3541415/\n",
      "\n",
      "\n",
      "序号: 10\n",
      "电影名称: 楚门的世界\n",
      "评分: 9.4\n",
      "推荐语: 如果再也不能见到你，祝你早安，午安，晚安。\n",
      "链接: https://movie.douban.com/subject/1292064/\n",
      "\n",
      "\n",
      "序号: 11\n",
      "电影名称: 辛德勒的名单\n",
      "评分: 9.5\n",
      "推荐语: 拯救一个人，就是拯救整个世界。\n",
      "链接: https://movie.douban.com/subject/1295124/\n",
      "\n",
      "\n",
      "序号: 12\n",
      "电影名称: 忠犬八公的故事\n",
      "评分: 9.4\n",
      "推荐语: 永远都不能忘记你所爱的人。\n",
      "链接: https://movie.douban.com/subject/3011091/\n",
      "\n",
      "\n",
      "序号: 13\n",
      "电影名称: 海上钢琴师\n",
      "评分: 9.3\n",
      "推荐语: 每个人都要走一条自己坚定了的路，就算是粉身碎骨。\n",
      "链接: https://movie.douban.com/subject/1292001/\n",
      "\n",
      "\n",
      "序号: 14\n",
      "电影名称: 三傻大闹宝莱坞\n",
      "评分: 9.2\n",
      "推荐语: 英俊版憨豆，高情商版谢耳朵。\n",
      "链接: https://movie.douban.com/subject/3793023/\n",
      "\n",
      "\n",
      "序号: 15\n",
      "电影名称: 放牛班的春天\n",
      "评分: 9.3\n",
      "推荐语: 天籁一般的童声，是最接近上帝的存在。\n",
      "链接: https://movie.douban.com/subject/1291549/\n",
      "\n",
      "\n",
      "序号: 16\n",
      "电影名称: 机器人总动员\n",
      "评分: 9.3\n",
      "推荐语: 小瓦力，大人生。\n",
      "链接: https://movie.douban.com/subject/2131459/\n",
      "\n",
      "\n",
      "序号: 17\n",
      "电影名称: 疯狂动物城\n",
      "评分: 9.2\n",
      "推荐语: 迪士尼给我们营造的乌托邦就是这样，永远善良勇敢，永远出乎意料。\n",
      "链接: https://movie.douban.com/subject/25662329/\n",
      "\n",
      "\n",
      "序号: 18\n",
      "电影名称: 无间道\n",
      "评分: 9.3\n",
      "推荐语: 香港电影史上永不过时的杰作。\n",
      "链接: https://movie.douban.com/subject/1307914/\n",
      "\n",
      "\n",
      "序号: 19\n",
      "电影名称: 控方证人\n",
      "评分: 9.6\n",
      "推荐语: 比利·怀德满分作品。\n",
      "链接: https://movie.douban.com/subject/1296141/\n",
      "\n",
      "\n",
      "序号: 20\n",
      "电影名称: 大话西游之大圣娶亲\n",
      "评分: 9.2\n",
      "推荐语: 一生所爱。\n",
      "链接: https://movie.douban.com/subject/1292213/\n",
      "\n",
      "\n",
      "序号: 21\n",
      "电影名称: 熔炉\n",
      "评分: 9.4\n",
      "推荐语: 我们一路奋战不是为了改变世界，而是为了不让世界改变我们。\n",
      "链接: https://movie.douban.com/subject/5912992/\n",
      "\n",
      "\n",
      "序号: 22\n",
      "电影名称: 教父\n",
      "评分: 9.3\n",
      "推荐语: 千万不要记恨你的对手，这样会让你失去理智。\n",
      "链接: https://movie.douban.com/subject/1291841/\n",
      "\n",
      "\n",
      "序号: 23\n",
      "电影名称: 触不可及\n",
      "评分: 9.3\n",
      "推荐语: 满满温情的高雅喜剧。\n",
      "链接: https://movie.douban.com/subject/6786002/\n",
      "\n",
      "\n",
      "序号: 24\n",
      "电影名称: 当幸福来敲门\n",
      "评分: 9.2\n",
      "推荐语: 平民励志片。\n",
      "链接: https://movie.douban.com/subject/1849031/\n",
      "\n",
      "\n",
      "序号: 25\n",
      "电影名称: 寻梦环游记\n",
      "评分: 9.1\n",
      "推荐语: 死亡不是真的逝去，遗忘才是永恒的消亡。\n",
      "链接: https://movie.douban.com/subject/20495023/\n",
      "\n",
      "\n",
      "序号: 26\n",
      "电影名称: 末代皇帝\n",
      "评分: 9.3\n",
      "推荐语: “不要跟我比惨，我比你更惨”再适合这部电影不过了。\n",
      "链接: https://movie.douban.com/subject/1293172/\n",
      "\n",
      "\n",
      "序号: 27\n",
      "电影名称: 龙猫\n",
      "评分: 9.2\n",
      "推荐语: 人人心中都有个龙猫，童年就永远不会消失。\n",
      "链接: https://movie.douban.com/subject/1291560/\n",
      "\n",
      "\n",
      "序号: 28\n",
      "电影名称: 怦然心动\n",
      "评分: 9.1\n",
      "推荐语: 真正的幸福是来自内心深处。\n",
      "链接: https://movie.douban.com/subject/3319755/\n",
      "\n",
      "\n",
      "序号: 29\n",
      "电影名称: 活着\n",
      "评分: 9.3\n",
      "推荐语: 张艺谋最好的电影。\n",
      "链接: https://movie.douban.com/subject/1292365/\n",
      "\n",
      "\n",
      "序号: 30\n",
      "电影名称: 哈利·波特与魔法石\n",
      "评分: 9.2\n",
      "推荐语: 童话世界的开端。\n",
      "链接: https://movie.douban.com/subject/1295038/\n",
      "\n",
      "\n",
      "序号: 31\n",
      "电影名称: 蝙蝠侠：黑暗骑士\n",
      "评分: 9.2\n",
      "推荐语: 无尽的黑暗。\n",
      "链接: https://movie.douban.com/subject/1851857/\n",
      "\n",
      "\n",
      "序号: 32\n",
      "电影名称: 指环王3：王者无敌\n",
      "评分: 9.3\n",
      "推荐语: 史诗的终章。\n",
      "链接: https://movie.douban.com/subject/1291552/\n",
      "\n",
      "\n",
      "序号: 33\n",
      "电影名称: 我不是药神\n",
      "评分: 9.0\n",
      "推荐语: 对我们国家而言，这样的电影多一部是一部。\n",
      "链接: https://movie.douban.com/subject/26752088/\n",
      "\n",
      "\n",
      "序号: 34\n",
      "电影名称: 乱世佳人\n",
      "评分: 9.3\n",
      "推荐语: Tomorrow is another day.\n",
      "链接: https://movie.douban.com/subject/1300267/\n",
      "\n",
      "\n",
      "序号: 35\n",
      "电影名称: 飞屋环游记\n",
      "评分: 9.1\n",
      "推荐语: 最后那些最无聊的事情，才是最值得怀念的。\n",
      "链接: https://movie.douban.com/subject/2129039/\n",
      "\n",
      "\n",
      "序号: 36\n",
      "电影名称: 素媛\n",
      "评分: 9.3\n",
      "推荐语: 受过伤害的人总是笑得最开心，因为他们不愿意让身边的人承受一样的痛苦。\n",
      "链接: https://movie.douban.com/subject/21937452/\n",
      "\n",
      "\n",
      "序号: 37\n",
      "电影名称: 哈尔的移动城堡\n",
      "评分: 9.1\n",
      "推荐语: 带着心爱的人在天空飞翔。\n",
      "链接: https://movie.douban.com/subject/1308807/\n",
      "\n",
      "\n",
      "序号: 38\n",
      "电影名称: 十二怒汉\n",
      "评分: 9.4\n",
      "推荐语: 1957年的理想主义。\n",
      "链接: https://movie.douban.com/subject/1293182/\n",
      "\n",
      "\n",
      "序号: 39\n",
      "电影名称: 让子弹飞\n",
      "评分: 9.0\n",
      "推荐语: 你给我翻译翻译，神马叫做TMD的惊喜。\n",
      "链接: https://movie.douban.com/subject/3742360/\n",
      "\n",
      "\n",
      "序号: 40\n",
      "电影名称: 何以为家\n",
      "评分: 9.1\n",
      "推荐语: 凝视卑弱生命，用电影改变命运。\n",
      "链接: https://movie.douban.com/subject/30170448/\n",
      "\n",
      "\n",
      "序号: 41\n",
      "电影名称: 摔跤吧！爸爸\n",
      "评分: 9.0\n",
      "推荐语: 你不是在为你一个人战斗，你要让千千万万的女性看到女生并不是只能相夫教子。\n",
      "链接: https://movie.douban.com/subject/26387939/\n",
      "\n",
      "\n",
      "序号: 42\n",
      "电影名称: 猫鼠游戏\n",
      "评分: 9.1\n",
      "推荐语: 骗子大师和执著警探的你追我跑故事。\n",
      "链接: https://movie.douban.com/subject/1305487/\n",
      "\n",
      "\n",
      "序号: 43\n",
      "电影名称: 天空之城\n",
      "评分: 9.2\n",
      "推荐语: 对天空的追逐，永不停止。\n",
      "链接: https://movie.douban.com/subject/1291583/\n",
      "\n",
      "\n",
      "序号: 44\n",
      "电影名称: 海蒂和爷爷\n",
      "评分: 9.3\n",
      "推荐语: 如果生活中有什么使你感到快乐，那就去做吧！不要管别人说什么。\n",
      "链接: https://movie.douban.com/subject/25958717/\n",
      "\n",
      "\n",
      "序号: 45\n",
      "电影名称: 鬼子来了\n",
      "评分: 9.3\n",
      "推荐语: 对敌人的仁慈，就是对自己残忍。\n",
      "链接: https://movie.douban.com/subject/1291858/\n",
      "\n",
      "\n",
      "序号: 46\n",
      "电影名称: 少年派的奇幻漂流\n",
      "评分: 9.1\n",
      "推荐语: 瑰丽壮观、无人能及的冒险之旅。\n",
      "链接: https://movie.douban.com/subject/1929463/\n",
      "\n",
      "\n",
      "序号: 47\n",
      "电影名称: 钢琴家\n",
      "评分: 9.3\n",
      "推荐语: 音乐能化解仇恨。\n",
      "链接: https://movie.douban.com/subject/1296736/\n",
      "\n",
      "\n",
      "序号: 48\n",
      "电影名称: 大话西游之月光宝盒\n",
      "评分: 9.0\n",
      "推荐语: 旷古烁今。\n",
      "链接: https://movie.douban.com/subject/1299398/\n",
      "\n",
      "\n",
      "序号: 49\n",
      "电影名称: 指环王2：双塔奇兵\n",
      "评分: 9.2\n",
      "推荐语: 承前启后的史诗篇章。\n",
      "链接: https://movie.douban.com/subject/1291572/\n",
      "\n",
      "\n",
      "序号: 50\n",
      "电影名称: 闻香识女人\n",
      "评分: 9.1\n",
      "推荐语: 史上最美的探戈。\n",
      "链接: https://movie.douban.com/subject/1298624/\n",
      "\n",
      "\n",
      "序号: 51\n",
      "电影名称: 死亡诗社\n",
      "评分: 9.2\n",
      "推荐语: 当一个死水般的体制内出现一个活跃的变数时，所有的腐臭都站在了光明的对面。\n",
      "链接: https://movie.douban.com/subject/1291548/\n",
      "\n",
      "\n",
      "序号: 52\n",
      "电影名称: 绿皮书\n",
      "评分: 8.9\n",
      "推荐语: 去除成见，需要勇气。\n",
      "链接: https://movie.douban.com/subject/27060077/\n",
      "\n",
      "\n",
      "序号: 53\n",
      "电影名称: 大闹天宫\n",
      "评分: 9.4\n",
      "推荐语: 经典之作，历久弥新。\n",
      "链接: https://movie.douban.com/subject/1418019/\n",
      "\n",
      "\n",
      "序号: 54\n",
      "电影名称: 罗马假日\n",
      "评分: 9.1\n",
      "推荐语: 爱情哪怕只有一天。\n",
      "链接: https://movie.douban.com/subject/1293839/\n",
      "\n",
      "\n",
      "序号: 55\n",
      "电影名称: 指环王1：护戒使者\n",
      "评分: 9.1\n",
      "推荐语: 传说的开始。\n",
      "链接: https://movie.douban.com/subject/1291571/\n",
      "\n",
      "\n",
      "序号: 56\n",
      "电影名称: 黑客帝国\n",
      "评分: 9.1\n",
      "推荐语: 视觉革命。\n",
      "链接: https://movie.douban.com/subject/1291843/\n",
      "\n",
      "\n",
      "序号: 57\n",
      "电影名称: 天堂电影院\n",
      "评分: 9.2\n",
      "推荐语: 那些吻戏，那些青春，都在影院的黑暗里被泪水冲刷得无比清晰。\n",
      "链接: https://movie.douban.com/subject/1291828/\n",
      "\n",
      "\n",
      "序号: 58\n",
      "电影名称: 教父2\n",
      "评分: 9.3\n",
      "推荐语: 优雅的孤独。\n",
      "链接: https://movie.douban.com/subject/1299131/\n",
      "\n",
      "\n",
      "序号: 59\n",
      "电影名称: 狮子王\n",
      "评分: 9.1\n",
      "推荐语: 动物版《哈姆雷特》。\n",
      "链接: https://movie.douban.com/subject/1301753/\n",
      "\n",
      "\n",
      "序号: 60\n",
      "电影名称: 辩护人\n",
      "评分: 9.2\n",
      "推荐语: 电影的现实意义大过电影本身。\n",
      "链接: https://movie.douban.com/subject/21937445/\n",
      "\n",
      "\n",
      "序号: 61\n",
      "电影名称: 饮食男女\n",
      "评分: 9.2\n",
      "推荐语: 人生不能像做菜，把所有的料都准备好了才下锅。\n",
      "链接: https://movie.douban.com/subject/1291818/\n",
      "\n",
      "\n",
      "序号: 62\n",
      "电影名称: 搏击俱乐部\n",
      "评分: 9.0\n",
      "推荐语: 邪恶与平庸蛰伏于同一个母体，在特定的时间互相对峙。\n",
      "链接: https://movie.douban.com/subject/1292000/\n",
      "\n",
      "\n",
      "序号: 63\n",
      "电影名称: 本杰明·巴顿奇事\n",
      "评分: 9.0\n",
      "推荐语: 在时间之河里感受溺水之苦。\n",
      "链接: https://movie.douban.com/subject/1485260/\n",
      "\n",
      "\n",
      "序号: 64\n",
      "电影名称: 美丽心灵\n",
      "评分: 9.1\n",
      "推荐语: 爱是一切逻辑和原由。\n",
      "链接: https://movie.douban.com/subject/1306029/\n",
      "\n",
      "\n",
      "序号: 65\n",
      "电影名称: 穿条纹睡衣的男孩\n",
      "评分: 9.2\n",
      "推荐语: 尽管有些不切实际的幻想，这部电影依旧是一部感人肺腑的佳作。\n",
      "链接: https://movie.douban.com/subject/3008247/\n",
      "\n",
      "\n",
      "序号: 66\n",
      "电影名称: 窃听风暴\n",
      "评分: 9.2\n",
      "推荐语: 别样人生。\n",
      "链接: https://movie.douban.com/subject/1900841/\n",
      "\n",
      "\n",
      "序号: 67\n",
      "电影名称: 情书\n",
      "评分: 8.9\n",
      "推荐语: 暗恋的极致。\n",
      "链接: https://movie.douban.com/subject/1292220/\n",
      "\n",
      "\n",
      "序号: 68\n",
      "电影名称: 两杆大烟枪\n",
      "评分: 9.1\n",
      "推荐语: 4个臭皮匠顶个诸葛亮，盖·里奇果然不是盖的。\n",
      "链接: https://movie.douban.com/subject/1293350/\n",
      "\n",
      "\n",
      "序号: 69\n",
      "电影名称: 西西里的美丽传说\n",
      "评分: 8.9\n",
      "推荐语: 美丽无罪。\n",
      "链接: https://movie.douban.com/subject/1292402/\n",
      "\n",
      "\n",
      "序号: 70\n",
      "电影名称: 音乐之声\n",
      "评分: 9.1\n",
      "推荐语: 用音乐化解仇恨，让歌声串起美好。\n",
      "链接: https://movie.douban.com/subject/1294408/\n",
      "\n",
      "\n",
      "序号: 71\n",
      "电影名称: 看不见的客人\n",
      "评分: 8.8\n",
      "推荐语: 你以为你以为的就是你以为的。\n",
      "链接: https://movie.douban.com/subject/26580232/\n",
      "\n",
      "\n",
      "序号: 72\n",
      "电影名称: 哈利·波特与死亡圣器(下)\n",
      "评分: 9.0\n",
      "推荐语: 10年的完美句点。\n",
      "链接: https://movie.douban.com/subject/3011235/\n",
      "\n",
      "\n",
      "序号: 73\n",
      "电影名称: 阿凡达\n",
      "评分: 8.8\n",
      "推荐语: 绝对意义上的美轮美奂。\n",
      "链接: https://movie.douban.com/subject/1652587/\n",
      "\n",
      "\n",
      "序号: 74\n",
      "电影名称: 拯救大兵瑞恩\n",
      "评分: 9.1\n",
      "推荐语: 美利坚精神输出大片No1.\n",
      "链接: https://movie.douban.com/subject/1292849/\n",
      "\n",
      "\n",
      "序号: 75\n",
      "电影名称: 飞越疯人院\n",
      "评分: 9.1\n",
      "推荐语: 自由万岁。\n",
      "链接: https://movie.douban.com/subject/1292224/\n",
      "\n",
      "\n",
      "序号: 76\n",
      "电影名称: 小鞋子\n",
      "评分: 9.2\n",
      "推荐语: 奔跑的孩子是天使。\n",
      "链接: https://movie.douban.com/subject/1303021/\n",
      "\n",
      "\n",
      "序号: 77\n",
      "电影名称: 功夫\n",
      "评分: 8.8\n",
      "推荐语: 警恶惩奸，维护世界和平这个任务就交给你了，好吗？\n",
      "链接: https://movie.douban.com/subject/1291543/\n",
      "\n",
      "\n",
      "序号: 78\n",
      "电影名称: 沉默的羔羊\n",
      "评分: 8.9\n",
      "推荐语: 安东尼·霍普金斯的顶级表演。\n",
      "链接: https://movie.douban.com/subject/1293544/\n",
      "\n",
      "\n",
      "序号: 79\n",
      "电影名称: 布达佩斯大饭店\n",
      "评分: 8.9\n",
      "推荐语: 小清新的故事里注入了大历史的情怀。\n",
      "链接: https://movie.douban.com/subject/11525673/\n",
      "\n",
      "\n",
      "序号: 80\n",
      "电影名称: 禁闭岛\n",
      "评分: 8.9\n",
      "推荐语: 昔日翩翩少年，今日大腹便便。\n",
      "链接: https://movie.douban.com/subject/2334904/\n",
      "\n",
      "\n",
      "序号: 81\n",
      "电影名称: 蝴蝶效应\n",
      "评分: 8.9\n",
      "推荐语: 人的命运被自己瞬间的抉择改变。\n",
      "链接: https://movie.douban.com/subject/1292343/\n",
      "\n",
      "\n",
      "序号: 82\n",
      "电影名称: 哈利·波特与阿兹卡班的囚徒\n",
      "评分: 9.0\n",
      "推荐语: 不一样的导演，不一样的哈利·波特。\n",
      "链接: https://movie.douban.com/subject/1291544/\n",
      "\n",
      "\n",
      "序号: 83\n",
      "电影名称: 致命魔术\n",
      "评分: 8.9\n",
      "推荐语: 孪生蝙蝠侠大战克隆金刚狼。\n",
      "链接: https://movie.douban.com/subject/1780330/\n",
      "\n",
      "\n",
      "序号: 84\n",
      "电影名称: 心灵捕手\n",
      "评分: 9.0\n",
      "推荐语: 人生中应该拥有这样的一段豁然开朗。\n",
      "链接: https://movie.douban.com/subject/1292656/\n",
      "\n",
      "\n",
      "序号: 85\n",
      "电影名称: 超脱\n",
      "评分: 9.0\n",
      "推荐语: 穷尽一生，我们要学会的，不过是彼此拥抱。\n",
      "链接: https://movie.douban.com/subject/5322596/\n",
      "\n",
      "\n",
      "序号: 86\n",
      "电影名称: 低俗小说\n",
      "评分: 8.9\n",
      "推荐语: 故事的高级讲法。\n",
      "链接: https://movie.douban.com/subject/1291832/\n",
      "\n",
      "\n",
      "序号: 87\n",
      "电影名称: 摩登时代\n",
      "评分: 9.3\n",
      "推荐语: 大时代中的人生，小人物的悲喜。\n",
      "链接: https://movie.douban.com/subject/1294371/\n",
      "\n",
      "\n",
      "序号: 88\n",
      "电影名称: 春光乍泄\n",
      "评分: 9.0\n",
      "推荐语: 爱情纠缠，男女一致。\n",
      "链接: https://movie.douban.com/subject/1292679/\n",
      "\n",
      "\n",
      "序号: 89\n",
      "电影名称: 海豚湾\n",
      "评分: 9.3\n",
      "推荐语: 海豚的微笑，是世界上最高明的伪装。\n",
      "链接: https://movie.douban.com/subject/3442220/\n",
      "\n",
      "\n",
      "序号: 90\n",
      "电影名称: 喜剧之王\n",
      "评分: 8.8\n",
      "推荐语: 我是一个演员。\n",
      "链接: https://movie.douban.com/subject/1302425/\n",
      "\n",
      "\n",
      "序号: 91\n",
      "电影名称: 美国往事\n",
      "评分: 9.2\n",
      "推荐语: 往事如烟，无处祭奠。\n",
      "链接: https://movie.douban.com/subject/1292262/\n",
      "\n",
      "\n",
      "序号: 92\n",
      "电影名称: 致命ID\n",
      "评分: 8.9\n",
      "推荐语: 最不可能的那个人永远是最可能的。\n",
      "链接: https://movie.douban.com/subject/1297192/\n",
      "\n",
      "\n",
      "序号: 93\n",
      "电影名称: 杀人回忆\n",
      "评分: 8.9\n",
      "推荐语: 关于连环杀人悬案的集体回忆。\n",
      "链接: https://movie.douban.com/subject/1300299/\n",
      "\n",
      "\n",
      "序号: 94\n",
      "电影名称: 哈利·波特与密室\n",
      "评分: 8.9\n",
      "推荐语: 魔法的密室之门已打开...\n",
      "链接: https://movie.douban.com/subject/1296996/\n",
      "\n",
      "\n",
      "序号: 95\n",
      "电影名称: 红辣椒\n",
      "评分: 9.1\n",
      "推荐语: 梦的勾结。\n",
      "链接: https://movie.douban.com/subject/1865703/\n",
      "\n",
      "\n",
      "序号: 96\n",
      "电影名称: 加勒比海盗\n",
      "评分: 8.8\n",
      "推荐语: 约翰尼·德普的独角戏。\n",
      "链接: https://movie.douban.com/subject/1298070/\n",
      "\n",
      "\n",
      "序号: 97\n",
      "电影名称: 七宗罪\n",
      "评分: 8.8\n",
      "推荐语: 警察抓小偷，老鼠玩死猫。\n",
      "链接: https://movie.douban.com/subject/1292223/\n",
      "\n",
      "\n",
      "序号: 98\n",
      "电影名称: 一一\n",
      "评分: 9.1\n",
      "推荐语: 我们都曾经是一一。\n",
      "链接: https://movie.douban.com/subject/1292434/\n",
      "\n",
      "\n",
      "序号: 99\n",
      "电影名称: 狩猎\n",
      "评分: 9.1\n",
      "推荐语: 人言可畏。\n",
      "链接: https://movie.douban.com/subject/6985810/\n",
      "\n",
      "\n",
      "序号: 100\n",
      "电影名称: 唐伯虎点秋香\n",
      "评分: 8.7\n",
      "推荐语: 华太师是黄霑，吴镇宇四大才子之一。\n",
      "链接: https://movie.douban.com/subject/1306249/\n",
      "\n",
      "\n",
      "序号: 101\n",
      "电影名称: 7号房的礼物\n",
      "评分: 8.9\n",
      "推荐语: 《我是山姆》的《美丽人生》。\n",
      "链接: https://movie.douban.com/subject/10777687/\n",
      "\n",
      "\n",
      "序号: 102\n",
      "电影名称: 被嫌弃的松子的一生\n",
      "评分: 8.9\n",
      "推荐语: 以戏谑来戏谑戏谑。\n",
      "链接: https://movie.douban.com/subject/1787291/\n",
      "\n",
      "\n",
      "序号: 103\n",
      "电影名称: 蝙蝠侠：黑暗骑士崛起\n",
      "评分: 8.9\n",
      "推荐语: 诺兰就是保证。\n",
      "链接: https://movie.douban.com/subject/3395373/\n",
      "\n",
      "\n",
      "序号: 104\n",
      "电影名称: 甜蜜蜜\n",
      "评分: 8.9\n",
      "推荐语: 相逢只要一瞬间，等待却像是一辈子。\n",
      "链接: https://movie.douban.com/subject/1305164/\n",
      "\n",
      "\n",
      "序号: 105\n",
      "电影名称: 爱在黎明破晓前\n",
      "评分: 8.8\n",
      "推荐语: 缘分是个连绵词，最美不过一瞬。\n",
      "链接: https://movie.douban.com/subject/1296339/\n",
      "\n",
      "\n",
      "序号: 106\n",
      "电影名称: 请以你的名字呼唤我\n",
      "评分: 8.8\n",
      "推荐语: 沉醉在电影的情感和视听氛围中无法自拔。\n",
      "链接: https://movie.douban.com/subject/26799731/\n",
      "\n",
      "\n",
      "序号: 107\n",
      "电影名称: 第六感\n",
      "评分: 8.9\n",
      "推荐语: 深入内心的恐怖，出人意料的结局。\n",
      "链接: https://movie.douban.com/subject/1297630/\n",
      "\n",
      "\n",
      "序号: 108\n",
      "电影名称: 入殓师\n",
      "评分: 8.9\n",
      "推荐语: 死可能是一道门，逝去并不是终结，而是超越，走向下一程。\n",
      "链接: https://movie.douban.com/subject/2149806/\n",
      "\n",
      "\n",
      "序号: 109\n",
      "电影名称: 超能陆战队\n",
      "评分: 8.7\n",
      "推荐语: Balalala~~~\n",
      "链接: https://movie.douban.com/subject/11026735/\n",
      "\n",
      "\n",
      "序号: 110\n",
      "电影名称: 断背山\n",
      "评分: 8.8\n",
      "推荐语: 每个人心中都有一座断背山。\n",
      "链接: https://movie.douban.com/subject/1418834/\n",
      "\n",
      "\n",
      "序号: 111\n",
      "电影名称: 重庆森林\n",
      "评分: 8.8\n",
      "推荐语: 寂寞没有期限。\n",
      "链接: https://movie.douban.com/subject/1291999/\n",
      "\n",
      "\n",
      "序号: 112\n",
      "电影名称: 剪刀手爱德华\n",
      "评分: 8.7\n",
      "推荐语: 浪漫忧郁的成人童话。\n",
      "链接: https://movie.douban.com/subject/1292370/\n",
      "\n",
      "\n",
      "序号: 113\n",
      "电影名称: 勇敢的心\n",
      "评分: 8.9\n",
      "推荐语: 史诗大片的典范。\n",
      "链接: https://movie.douban.com/subject/1294639/\n",
      "\n",
      "\n",
      "序号: 114\n",
      "电影名称: 幽灵公主\n",
      "评分: 8.9\n",
      "推荐语: 人与自然的战争史诗。\n",
      "链接: https://movie.douban.com/subject/1297359/\n",
      "\n",
      "\n",
      "序号: 115\n",
      "电影名称: 爱在日落黄昏时\n",
      "评分: 8.9\n",
      "推荐语: 九年后的重逢是世俗和责任的交叠，没了悸动和青涩，沧桑而温暖。\n",
      "链接: https://movie.douban.com/subject/1291990/\n",
      "\n",
      "\n",
      "序号: 116\n",
      "电影名称: 寄生虫\n",
      "评分: 8.8\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/27010768/\n",
      "\n",
      "\n",
      "序号: 117\n",
      "电影名称: 菊次郎的夏天\n",
      "评分: 8.9\n",
      "推荐语: 从没见过那么流氓的温柔，从没见过那么温柔的流氓。\n",
      "链接: https://movie.douban.com/subject/1293359/\n",
      "\n",
      "\n",
      "序号: 118\n",
      "电影名称: 借东西的小人阿莉埃蒂\n",
      "评分: 8.9\n",
      "推荐语: 曾经的那段美好会沉淀为一辈子的记忆。\n",
      "链接: https://movie.douban.com/subject/4202302/\n",
      "\n",
      "\n",
      "序号: 119\n",
      "电影名称: 消失的爱人\n",
      "评分: 8.7\n",
      "推荐语: 年度最佳date movie。\n",
      "链接: https://movie.douban.com/subject/21318488/\n",
      "\n",
      "\n",
      "序号: 120\n",
      "电影名称: 无人知晓\n",
      "评分: 9.1\n",
      "推荐语: 我的平常生活就是他人的幸福。\n",
      "链接: https://movie.douban.com/subject/1292337/\n",
      "\n",
      "\n",
      "序号: 121\n",
      "电影名称: 阳光灿烂的日子\n",
      "评分: 8.8\n",
      "推荐语: 一场华丽的意淫。\n",
      "链接: https://movie.douban.com/subject/1291875/\n",
      "\n",
      "\n",
      "序号: 122\n",
      "电影名称: 时空恋旅人\n",
      "评分: 8.8\n",
      "推荐语: 把每天当作最后一天般珍惜度过，积极拥抱生活，就是幸福。\n",
      "链接: https://movie.douban.com/subject/10577869/\n",
      "\n",
      "\n",
      "序号: 123\n",
      "电影名称: 完美的世界\n",
      "评分: 9.1\n",
      "推荐语: 坏人的好总是比好人的好来得更感人。\n",
      "链接: https://movie.douban.com/subject/1300992/\n",
      "\n",
      "\n",
      "序号: 124\n",
      "电影名称: 倩女幽魂\n",
      "评分: 8.8\n",
      "推荐语: 两张绝世的脸。\n",
      "链接: https://movie.douban.com/subject/1297447/\n",
      "\n",
      "\n",
      "序号: 125\n",
      "电影名称: 未麻的部屋\n",
      "评分: 9.1\n",
      "推荐语: 好的剧本是，就算你猜到了结局也猜不到全部。\n",
      "链接: https://movie.douban.com/subject/1395091/\n",
      "\n",
      "\n",
      "序号: 126\n",
      "电影名称: 天使爱美丽\n",
      "评分: 8.7\n",
      "推荐语: 法式小清新。\n",
      "链接: https://movie.douban.com/subject/1292215/\n",
      "\n",
      "\n",
      "序号: 127\n",
      "电影名称: 小森林 夏秋篇\n",
      "评分: 9.0\n",
      "推荐语: 那些静得只能听见呼吸的日子里，你明白孤独即生活。\n",
      "链接: https://movie.douban.com/subject/25814705/\n",
      "\n",
      "\n",
      "序号: 128\n",
      "电影名称: 哈利·波特与火焰杯\n",
      "评分: 8.8\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/1309055/\n",
      "\n",
      "\n",
      "序号: 129\n",
      "电影名称: 侧耳倾听\n",
      "评分: 8.9\n",
      "推荐语: 少女情怀总是诗。\n",
      "链接: https://movie.douban.com/subject/1297052/\n",
      "\n",
      "\n",
      "序号: 130\n",
      "电影名称: 驯龙高手\n",
      "评分: 8.8\n",
      "推荐语: 和谐的生活离不开摸头与被摸头。\n",
      "链接: https://movie.douban.com/subject/2353023/\n",
      "\n",
      "\n",
      "序号: 131\n",
      "电影名称: 幸福终点站\n",
      "评分: 8.8\n",
      "推荐语: 有时候幸福需要等一等。\n",
      "链接: https://movie.douban.com/subject/1292274/\n",
      "\n",
      "\n",
      "序号: 132\n",
      "电影名称: 一个叫欧维的男人决定去死\n",
      "评分: 8.9\n",
      "推荐语: 惠及一生的美丽。\n",
      "链接: https://movie.douban.com/subject/26628357/\n",
      "\n",
      "\n",
      "序号: 133\n",
      "电影名称: 教父3\n",
      "评分: 9.0\n",
      "推荐语: 任何信念的力量，都无法改变命运。\n",
      "链接: https://movie.douban.com/subject/1294240/\n",
      "\n",
      "\n",
      "序号: 134\n",
      "电影名称: 怪兽电力公司\n",
      "评分: 8.8\n",
      "推荐语: 不要给它起名字，起了名字就有感情了。\n",
      "链接: https://movie.douban.com/subject/1291579/\n",
      "\n",
      "\n",
      "序号: 135\n",
      "电影名称: 新世界\n",
      "评分: 8.9\n",
      "推荐语: 要做就做得狠一点，这样才能活下去。\n",
      "链接: https://movie.douban.com/subject/10437779/\n",
      "\n",
      "\n",
      "序号: 136\n",
      "电影名称: 小森林 冬春篇\n",
      "评分: 9.0\n",
      "推荐语: 尊敬他人，尊敬你生活的这片土地，明白孤独是人生的常态。\n",
      "链接: https://movie.douban.com/subject/25814707/\n",
      "\n",
      "\n",
      "序号: 137\n",
      "电影名称: 茶馆\n",
      "评分: 9.6\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/1461403/\n",
      "\n",
      "\n",
      "序号: 138\n",
      "电影名称: 玩具总动员3\n",
      "评分: 8.9\n",
      "推荐语: 跨度十五年的欢乐与泪水。\n",
      "链接: https://movie.douban.com/subject/1858711/\n",
      "\n",
      "\n",
      "序号: 139\n",
      "电影名称: 傲慢与偏见\n",
      "评分: 8.7\n",
      "推荐语: 爱是摈弃傲慢与偏见之后的曙光。\n",
      "链接: https://movie.douban.com/subject/1418200/\n",
      "\n",
      "\n",
      "序号: 140\n",
      "电影名称: 萤火之森\n",
      "评分: 8.9\n",
      "推荐语: 触不到的恋人。\n",
      "链接: https://movie.douban.com/subject/5989818/\n",
      "\n",
      "\n",
      "序号: 141\n",
      "电影名称: 被解救的姜戈\n",
      "评分: 8.8\n",
      "推荐语: 热血沸腾，那个低俗、性感的无耻混蛋又来了。\n",
      "链接: https://movie.douban.com/subject/6307447/\n",
      "\n",
      "\n",
      "序号: 142\n",
      "电影名称: 釜山行\n",
      "评分: 8.6\n",
      "推荐语: 揭露人性的丧尸题材力作。\n",
      "链接: https://movie.douban.com/subject/25986180/\n",
      "\n",
      "\n",
      "序号: 143\n",
      "电影名称: 神偷奶爸\n",
      "评分: 8.7\n",
      "推荐语: Mr. I Don't Care其实也有Care的时候。\n",
      "链接: https://movie.douban.com/subject/3287562/\n",
      "\n",
      "\n",
      "序号: 144\n",
      "电影名称: 色，戒\n",
      "评分: 8.7\n",
      "推荐语: 假戏真情，爱欲深海\n",
      "链接: https://movie.douban.com/subject/1828115/\n",
      "\n",
      "\n",
      "序号: 145\n",
      "电影名称: 九品芝麻官\n",
      "评分: 8.7\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/1297518/\n",
      "\n",
      "\n",
      "序号: 146\n",
      "电影名称: 告白\n",
      "评分: 8.8\n",
      "推荐语: 没有一人完全善，也没有一人完全恶。\n",
      "链接: https://movie.douban.com/subject/4268598/\n",
      "\n",
      "\n",
      "序号: 147\n",
      "电影名称: 哪吒闹海\n",
      "评分: 9.2\n",
      "推荐语: 想你时你在闹海。\n",
      "链接: https://movie.douban.com/subject/1307315/\n",
      "\n",
      "\n",
      "序号: 148\n",
      "电影名称: 玛丽和马克思\n",
      "评分: 9.0\n",
      "推荐语: 你是我最好的朋友，你是我唯一的朋友 。\n",
      "链接: https://movie.douban.com/subject/3072124/\n",
      "\n",
      "\n",
      "序号: 149\n",
      "电影名称: 喜宴\n",
      "评分: 9.0\n",
      "推荐语: 中国家庭的喜怒哀乐忍。\n",
      "链接: https://movie.douban.com/subject/1303037/\n",
      "\n",
      "\n",
      "序号: 150\n",
      "电影名称: 大鱼\n",
      "评分: 8.8\n",
      "推荐语: 抱着梦想而活着的人是幸福的，怀抱梦想而死去的人是不朽的。\n",
      "链接: https://movie.douban.com/subject/1291545/\n",
      "\n",
      "\n",
      "序号: 151\n",
      "电影名称: 模仿游戏\n",
      "评分: 8.8\n",
      "推荐语: 他给机器起名“克里斯托弗”，因为这是他初恋的名字。\n",
      "链接: https://movie.douban.com/subject/10463953/\n",
      "\n",
      "\n",
      "序号: 152\n",
      "电影名称: 头号玩家\n",
      "评分: 8.6\n",
      "推荐语: 写给影迷，动漫迷和游戏迷的一封情书。\n",
      "链接: https://movie.douban.com/subject/4920389/\n",
      "\n",
      "\n",
      "序号: 153\n",
      "电影名称: 花样年华\n",
      "评分: 8.8\n",
      "推荐语: 偷情本没有这样美。\n",
      "链接: https://movie.douban.com/subject/1291557/\n",
      "\n",
      "\n",
      "序号: 154\n",
      "电影名称: 头脑特工队\n",
      "评分: 8.8\n",
      "推荐语: 愿我们都不用长大，每一座城堡都能永远存在。\n",
      "链接: https://movie.douban.com/subject/10533913/\n",
      "\n",
      "\n",
      "序号: 155\n",
      "电影名称: 射雕英雄传之东成西就\n",
      "评分: 8.7\n",
      "推荐语: 百看不厌。\n",
      "链接: https://movie.douban.com/subject/1316510/\n",
      "\n",
      "\n",
      "序号: 156\n",
      "电影名称: 我是山姆\n",
      "评分: 9.0\n",
      "推荐语: 爱并不需要智商 。\n",
      "链接: https://movie.douban.com/subject/1306861/\n",
      "\n",
      "\n",
      "序号: 157\n",
      "电影名称: 七武士\n",
      "评分: 9.3\n",
      "推荐语: 时代悲歌。\n",
      "链接: https://movie.douban.com/subject/1295399/\n",
      "\n",
      "\n",
      "序号: 158\n",
      "电影名称: 血战钢锯岭\n",
      "评分: 8.7\n",
      "推荐语: 优秀的战争片不会美化战场，不会粉饰死亡，不会矮化敌人，不会无视常识，最重要的，不会宣扬战争。\n",
      "链接: https://movie.douban.com/subject/26325320/\n",
      "\n",
      "\n",
      "序号: 159\n",
      "电影名称: 阳光姐妹淘\n",
      "评分: 8.8\n",
      "推荐语: 再多各自牛逼的时光，也比不上一起傻逼的岁月。\n",
      "链接: https://movie.douban.com/subject/4917726/\n",
      "\n",
      "\n",
      "序号: 160\n",
      "电影名称: 惊魂记\n",
      "评分: 9.0\n",
      "推荐语: 故事的反转与反转，分裂电影的始祖。\n",
      "链接: https://movie.douban.com/subject/1293181/\n",
      "\n",
      "\n",
      "序号: 161\n",
      "电影名称: 恐怖直播\n",
      "评分: 8.7\n",
      "推荐语: 恐怖分子的“秋菊打官司”。\n",
      "链接: https://movie.douban.com/subject/21360417/\n",
      "\n",
      "\n",
      "序号: 162\n",
      "电影名称: 黑客帝国3：矩阵革命\n",
      "评分: 8.8\n",
      "推荐语: 不得不说，《黑客帝国》系列是商业片与科幻、哲学完美结合的典范。\n",
      "链接: https://movie.douban.com/subject/1302467/\n",
      "\n",
      "\n",
      "序号: 163\n",
      "电影名称: 你的名字。\n",
      "评分: 8.5\n",
      "推荐语: 穿越错位的时空，仰望陨落的星辰，你没留下你的名字，我却无法忘记那句“我爱你”。\n",
      "链接: https://movie.douban.com/subject/26683290/\n",
      "\n",
      "\n",
      "序号: 164\n",
      "电影名称: 三块广告牌\n",
      "评分: 8.7\n",
      "推荐语: 怼天怼地，你走后，她与世界为敌。\n",
      "链接: https://movie.douban.com/subject/26611804/\n",
      "\n",
      "\n",
      "序号: 165\n",
      "电影名称: 电锯惊魂\n",
      "评分: 8.7\n",
      "推荐语: 真相就在眼前。\n",
      "链接: https://movie.douban.com/subject/1417598/\n",
      "\n",
      "\n",
      "序号: 166\n",
      "电影名称: 心迷宫\n",
      "评分: 8.8\n",
      "推荐语: 荒诞讽刺，千奇百巧，抽丝剥茧，百转千回。\n",
      "链接: https://movie.douban.com/subject/25917973/\n",
      "\n",
      "\n",
      "序号: 167\n",
      "电影名称: 达拉斯买家俱乐部\n",
      "评分: 8.8\n",
      "推荐语: Jared Leto的腿比女人还美！\n",
      "链接: https://movie.douban.com/subject/1793929/\n",
      "\n",
      "\n",
      "序号: 168\n",
      "电影名称: 疯狂原始人\n",
      "评分: 8.7\n",
      "推荐语: 老少皆宜，这就是好莱坞动画的魅力。\n",
      "链接: https://movie.douban.com/subject/1907966/\n",
      "\n",
      "\n",
      "序号: 169\n",
      "电影名称: 谍影重重3\n",
      "评分: 8.8\n",
      "推荐语: 像吃了苏打饼一样干脆的电影。\n",
      "链接: https://movie.douban.com/subject/1578507/\n",
      "\n",
      "\n",
      "序号: 170\n",
      "电影名称: 小丑\n",
      "评分: 8.7\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/27119724/\n",
      "\n",
      "\n",
      "序号: 171\n",
      "电影名称: 英雄本色\n",
      "评分: 8.6\n",
      "推荐语: 英雄泪短，兄弟情长。\n",
      "链接: https://movie.douban.com/subject/1297574/\n",
      "\n",
      "\n",
      "序号: 172\n",
      "电影名称: 上帝之城\n",
      "评分: 9.0\n",
      "推荐语: 被上帝抛弃了的上帝之城。\n",
      "链接: https://movie.douban.com/subject/1292208/\n",
      "\n",
      "\n",
      "序号: 173\n",
      "电影名称: 风之谷\n",
      "评分: 8.9\n",
      "推荐语: 动画片的圣经。\n",
      "链接: https://movie.douban.com/subject/1291585/\n",
      "\n",
      "\n",
      "序号: 174\n",
      "电影名称: 绿里奇迹\n",
      "评分: 8.9\n",
      "推荐语: 天使暂时离开。\n",
      "链接: https://movie.douban.com/subject/1300374/\n",
      "\n",
      "\n",
      "序号: 175\n",
      "电影名称: 爱在午夜降临前\n",
      "评分: 8.9\n",
      "推荐语: 所谓爱情，就是话唠一路，都不会心生腻烦，彼此嫌弃。\n",
      "链接: https://movie.douban.com/subject/10808442/\n",
      "\n",
      "\n",
      "序号: 176\n",
      "电影名称: 海街日记\n",
      "评分: 8.8\n",
      "推荐语: 是枝裕和的家庭习作。\n",
      "链接: https://movie.douban.com/subject/25895901/\n",
      "\n",
      "\n",
      "序号: 177\n",
      "电影名称: 背靠背，脸对脸\n",
      "评分: 9.5\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/1307856/\n",
      "\n",
      "\n",
      "序号: 178\n",
      "电影名称: 心灵奇旅\n",
      "评分: 8.7\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/24733428/\n",
      "\n",
      "\n",
      "序号: 179\n",
      "电影名称: 纵横四海\n",
      "评分: 8.8\n",
      "推荐语: 香港浪漫主义警匪动作片的巅峰之作。\n",
      "链接: https://movie.douban.com/subject/1295409/\n",
      "\n",
      "\n",
      "序号: 180\n",
      "电影名称: 卢旺达饭店\n",
      "评分: 8.9\n",
      "推荐语: 当这个世界闭上双眼，他却敞开了怀抱。\n",
      "链接: https://movie.douban.com/subject/1291822/\n",
      "\n",
      "\n",
      "序号: 181\n",
      "电影名称: 疯狂的石头\n",
      "评分: 8.6\n",
      "推荐语: 中国版《两杆大烟枪》。\n",
      "链接: https://movie.douban.com/subject/1862151/\n",
      "\n",
      "\n",
      "序号: 182\n",
      "电影名称: 记忆碎片\n",
      "评分: 8.7\n",
      "推荐语: 一个针管引发的血案。\n",
      "链接: https://movie.douban.com/subject/1304447/\n",
      "\n",
      "\n",
      "序号: 183\n",
      "电影名称: 无间道2\n",
      "评分: 8.7\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/1307106/\n",
      "\n",
      "\n",
      "序号: 184\n",
      "电影名称: 雨中曲\n",
      "评分: 9.1\n",
      "推荐语: 骨灰级歌舞片。\n",
      "链接: https://movie.douban.com/subject/1293460/\n",
      "\n",
      "\n",
      "序号: 185\n",
      "电影名称: 2001太空漫游\n",
      "评分: 8.9\n",
      "推荐语: 现代科幻电影的开山之作，最伟大导演的最伟大影片。\n",
      "链接: https://movie.douban.com/subject/1292226/\n",
      "\n",
      "\n",
      "序号: 186\n",
      "电影名称: 小偷家族\n",
      "评分: 8.7\n",
      "推荐语: 我们组成了家。\n",
      "链接: https://movie.douban.com/subject/27622447/\n",
      "\n",
      "\n",
      "序号: 187\n",
      "电影名称: 岁月神偷\n",
      "评分: 8.7\n",
      "推荐语: 岁月流逝，来日可追。\n",
      "链接: https://movie.douban.com/subject/3792799/\n",
      "\n",
      "\n",
      "序号: 188\n",
      "电影名称: 无敌破坏王\n",
      "评分: 8.7\n",
      "推荐语: 迪士尼和皮克斯拿错剧本的产物。\n",
      "链接: https://movie.douban.com/subject/6534248/\n",
      "\n",
      "\n",
      "序号: 189\n",
      "电影名称: 忠犬八公物语\n",
      "评分: 9.2\n",
      "推荐语: 养狗三日，便会对你终其一生。\n",
      "链接: https://movie.douban.com/subject/1959195/\n",
      "\n",
      "\n",
      "序号: 190\n",
      "电影名称: 荒蛮故事\n",
      "评分: 8.8\n",
      "推荐语: 始于荒诞，止于更荒诞。\n",
      "链接: https://movie.douban.com/subject/24750126/\n",
      "\n",
      "\n",
      "序号: 191\n",
      "电影名称: 冰川时代\n",
      "评分: 8.6\n",
      "推荐语: 松鼠才是角儿。\n",
      "链接: https://movie.douban.com/subject/1291578/\n",
      "\n",
      "\n",
      "序号: 192\n",
      "电影名称: 爆裂鼓手\n",
      "评分: 8.7\n",
      "推荐语: 这个世界从不善待努力的人，努力了也不一定会成功，但是知道自己在努力，就是活下去的动力。\n",
      "链接: https://movie.douban.com/subject/25773932/\n",
      "\n",
      "\n",
      "序号: 193\n",
      "电影名称: 恐怖游轮\n",
      "评分: 8.5\n",
      "推荐语: 不要企图在重复中寻找已经失去的爱。\n",
      "链接: https://movie.douban.com/subject/3011051/\n",
      "\n",
      "\n",
      "序号: 194\n",
      "电影名称: 牯岭街少年杀人事件\n",
      "评分: 8.9\n",
      "推荐语: 弱者送给弱者的一刀。\n",
      "链接: https://movie.douban.com/subject/1292329/\n",
      "\n",
      "\n",
      "序号: 195\n",
      "电影名称: 东京教父\n",
      "评分: 9.0\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/1310177/\n",
      "\n",
      "\n",
      "序号: 196\n",
      "电影名称: 魔女宅急便\n",
      "评分: 8.7\n",
      "推荐语: 宫崎骏的电影总让人感觉世界是美好的，阳光明媚的。\n",
      "链接: https://movie.douban.com/subject/1307811/\n",
      "\n",
      "\n",
      "序号: 197\n",
      "电影名称: 大佛普拉斯\n",
      "评分: 8.7\n",
      "推荐语: 人们可以登上月球，却永远无法探索人们内心的宇宙。\n",
      "链接: https://movie.douban.com/subject/27059130/\n",
      "\n",
      "\n",
      "序号: 198\n",
      "电影名称: 贫民窟的百万富翁\n",
      "评分: 8.6\n",
      "推荐语: 上帝之城+猜火车+阿甘正传+开心辞典=山寨富翁\n",
      "链接: https://movie.douban.com/subject/2209573/\n",
      "\n",
      "\n",
      "序号: 199\n",
      "电影名称: 遗愿清单\n",
      "评分: 8.7\n",
      "推荐语: 用剩余不多的时间，去燃烧整个生命。\n",
      "链接: https://movie.douban.com/subject/1867345/\n",
      "\n",
      "\n",
      "序号: 200\n",
      "电影名称: 东邪西毒\n",
      "评分: 8.6\n",
      "推荐语: 电影诗。\n",
      "链接: https://movie.douban.com/subject/1292328/\n",
      "\n",
      "\n",
      "序号: 201\n",
      "电影名称: 你看起来好像很好吃\n",
      "评分: 8.9\n",
      "推荐语: 感情不分食草或者食肉。\n",
      "链接: https://movie.douban.com/subject/4848115/\n",
      "\n",
      "\n",
      "序号: 202\n",
      "电影名称: 可可西里\n",
      "评分: 8.9\n",
      "推荐语: 坚硬的信仰。\n",
      "链接: https://movie.douban.com/subject/1308857/\n",
      "\n",
      "\n",
      "序号: 203\n",
      "电影名称: 末路狂花\n",
      "评分: 8.9\n",
      "推荐语: 没有了退路，只好飞向自由。\n",
      "链接: https://movie.douban.com/subject/1291992/\n",
      "\n",
      "\n",
      "序号: 204\n",
      "电影名称: 城市之光\n",
      "评分: 9.3\n",
      "推荐语: 永远的小人物，伟大的卓别林。\n",
      "链接: https://movie.douban.com/subject/1293908/\n",
      "\n",
      "\n",
      "序号: 205\n",
      "电影名称: 源代码\n",
      "评分: 8.5\n",
      "推荐语: 邓肯·琼斯继《月球》之后再度奉献出一部精彩绝伦的科幻佳作。\n",
      "链接: https://movie.douban.com/subject/3075287/\n",
      "\n",
      "\n",
      "序号: 206\n",
      "电影名称: 黑天鹅\n",
      "评分: 8.6\n",
      "推荐语: 黑暗之美。\n",
      "链接: https://movie.douban.com/subject/1978709/\n",
      "\n",
      "\n",
      "序号: 207\n",
      "电影名称: 海边的曼彻斯特\n",
      "评分: 8.6\n",
      "推荐语: 我们都有权利不与自己的过去和解。\n",
      "链接: https://movie.douban.com/subject/25980443/\n",
      "\n",
      "\n",
      "序号: 208\n",
      "电影名称: 真爱至上\n",
      "评分: 8.5\n",
      "推荐语: 爱，是个动词。\n",
      "链接: https://movie.douban.com/subject/1292401/\n",
      "\n",
      "\n",
      "序号: 209\n",
      "电影名称: 波西米亚狂想曲\n",
      "评分: 8.6\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/5300054/\n",
      "\n",
      "\n",
      "序号: 210\n",
      "电影名称: 雨人\n",
      "评分: 8.7\n",
      "推荐语: 生活在自己的世界里，也可以让周围的人显得可笑和渺小。\n",
      "链接: https://movie.douban.com/subject/1291870/\n",
      "\n",
      "\n",
      "序号: 211\n",
      "电影名称: 青蛇\n",
      "评分: 8.6\n",
      "推荐语: 人生如此，浮生如斯。谁人言，花彼岸，此生情长意短。谁都是不懂爱的罢了。\n",
      "链接: https://movie.douban.com/subject/1303394/\n",
      "\n",
      "\n",
      "序号: 212\n",
      "电影名称: 初恋这件小事\n",
      "评分: 8.5\n",
      "推荐语: 黑小鸭速效美白记。\n",
      "链接: https://movie.douban.com/subject/4739952/\n",
      "\n",
      "\n",
      "序号: 213\n",
      "电影名称: 爱乐之城\n",
      "评分: 8.4\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/25934014/\n",
      "\n",
      "\n",
      "序号: 214\n",
      "电影名称: 人工智能\n",
      "评分: 8.7\n",
      "推荐语: 对爱的执着，可以超越一切。\n",
      "链接: https://movie.douban.com/subject/1302827/\n",
      "\n",
      "\n",
      "序号: 215\n",
      "电影名称: 疯狂的麦克斯4：狂暴之路\n",
      "评分: 8.7\n",
      "推荐语: “多么美好的一天！”轰轰轰砰咚，啪哒哒哒轰隆隆，磅~\n",
      "链接: https://movie.douban.com/subject/3592854/\n",
      "\n",
      "\n",
      "序号: 216\n",
      "电影名称: 终结者2：审判日\n",
      "评分: 8.8\n",
      "推荐语: 少见的超越首部的续集，动作片中的经典。\n",
      "链接: https://movie.douban.com/subject/1291844/\n",
      "\n",
      "\n",
      "序号: 217\n",
      "电影名称: 恋恋笔记本\n",
      "评分: 8.5\n",
      "推荐语: 爱情没有那么多借口，如果不能圆满，只能说明爱的不够。\n",
      "链接: https://movie.douban.com/subject/1309163/\n",
      "\n",
      "\n",
      "序号: 218\n",
      "电影名称: 虎口脱险\n",
      "评分: 8.9\n",
      "推荐语: 永远看不腻的喜剧。\n",
      "链接: https://movie.douban.com/subject/1296909/\n",
      "\n",
      "\n",
      "序号: 219\n",
      "电影名称: 芙蓉镇\n",
      "评分: 9.3\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/1297880/\n",
      "\n",
      "\n",
      "序号: 220\n",
      "电影名称: 新龙门客栈\n",
      "评分: 8.7\n",
      "推荐语: 嬉笑怒骂，调风动月。\n",
      "链接: https://movie.douban.com/subject/1292287/\n",
      "\n",
      "\n",
      "序号: 221\n",
      "电影名称: 罗生门\n",
      "评分: 8.8\n",
      "推荐语: 人生的N种可能性。\n",
      "链接: https://movie.douban.com/subject/1291879/\n",
      "\n",
      "\n",
      "序号: 222\n",
      "电影名称: 无耻混蛋\n",
      "评分: 8.7\n",
      "推荐语: 昆汀同学越来越变态了，比北野武还杜琪峰。\n",
      "链接: https://movie.douban.com/subject/1438652/\n",
      "\n",
      "\n",
      "序号: 223\n",
      "电影名称: 崖上的波妞\n",
      "评分: 8.6\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/1959877/\n",
      "\n",
      "\n",
      "序号: 224\n",
      "电影名称: 花束般的恋爱\n",
      "评分: 8.6\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/34874432/\n",
      "\n",
      "\n",
      "序号: 225\n",
      "电影名称: 千钧一发\n",
      "评分: 8.8\n",
      "推荐语: 一部能引人思考的科幻励志片。\n",
      "链接: https://movie.douban.com/subject/1300117/\n",
      "\n",
      "\n",
      "序号: 226\n",
      "电影名称: 彗星来的那一夜\n",
      "评分: 8.6\n",
      "推荐语: 小成本大魅力。\n",
      "链接: https://movie.douban.com/subject/25807345/\n",
      "\n",
      "\n",
      "序号: 227\n",
      "电影名称: 哈利·波特与死亡圣器(上)\n",
      "评分: 8.6\n",
      "推荐语: 最忠于原著的一部。\n",
      "链接: https://movie.douban.com/subject/2051007/\n",
      "\n",
      "\n",
      "序号: 228\n",
      "电影名称: 萤火虫之墓\n",
      "评分: 8.7\n",
      "推荐语: 幸福是生生不息，却难以触及的远。\n",
      "链接: https://movie.douban.com/subject/1293318/\n",
      "\n",
      "\n",
      "序号: 229\n",
      "电影名称: 高山下的花环\n",
      "评分: 9.5\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/1422283/\n",
      "\n",
      "\n",
      "序号: 230\n",
      "电影名称: 白日梦想家\n",
      "评分: 8.6\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/2133323/\n",
      "\n",
      "\n",
      "序号: 231\n",
      "电影名称: 黑客帝国2：重装上阵\n",
      "评分: 8.7\n",
      "推荐语: 一个精彩的世界观正在缓缓建立。\n",
      "链接: https://movie.douban.com/subject/1304141/\n",
      "\n",
      "\n",
      "序号: 232\n",
      "电影名称: 奇迹男孩\n",
      "评分: 8.6\n",
      "推荐语: 世界不完美，爱会有奇迹。\n",
      "链接: https://movie.douban.com/subject/26787574/\n",
      "\n",
      "\n",
      "序号: 233\n",
      "电影名称: 二十二\n",
      "评分: 8.7\n",
      "推荐语: 有一些东西不应该被遗忘。\n",
      "链接: https://movie.douban.com/subject/26430107/\n",
      "\n",
      "\n",
      "序号: 234\n",
      "电影名称: 火星救援\n",
      "评分: 8.5\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/25864085/\n",
      "\n",
      "\n",
      "序号: 235\n",
      "电影名称: 战争之王\n",
      "评分: 8.7\n",
      "推荐语: 做一颗让别人需要你的棋子。\n",
      "链接: https://movie.douban.com/subject/1419936/\n",
      "\n",
      "\n",
      "序号: 236\n",
      "电影名称: 血钻\n",
      "评分: 8.7\n",
      "推荐语: 每个美丽事物背后都是滴血的现实。\n",
      "链接: https://movie.douban.com/subject/1428175/\n",
      "\n",
      "\n",
      "序号: 237\n",
      "电影名称: 步履不停\n",
      "评分: 8.8\n",
      "推荐语: 日本的家庭电影已经是世界巅峰了，步履不停是巅峰中的佳作。\n",
      "链接: https://movie.douban.com/subject/2222996/\n",
      "\n",
      "\n",
      "序号: 238\n",
      "电影名称: 千年女优\n",
      "评分: 8.8\n",
      "推荐语: 爱情是一场没有尽头的虚幻追逐。\n",
      "链接: https://movie.douban.com/subject/1307394/\n",
      "\n",
      "\n",
      "序号: 239\n",
      "电影名称: 哈利·波特与凤凰社\n",
      "评分: 8.5\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/1457217/\n",
      "\n",
      "\n",
      "序号: 240\n",
      "电影名称: 房间\n",
      "评分: 8.8\n",
      "推荐语: 被偷走的岁月，被伤害的生命，被禁锢的灵魂，终将被希望和善意救赎。\n",
      "链接: https://movie.douban.com/subject/25724855/\n",
      "\n",
      "\n",
      "序号: 241\n",
      "电影名称: 魂断蓝桥\n",
      "评分: 8.8\n",
      "推荐语: 中国式内在的美国电影。\n",
      "链接: https://movie.douban.com/subject/1293964/\n",
      "\n",
      "\n",
      "序号: 242\n",
      "电影名称: 谍影重重2\n",
      "评分: 8.7\n",
      "推荐语: 谁说王家卫镜头很晃？\n",
      "链接: https://movie.douban.com/subject/1308767/\n",
      "\n",
      "\n",
      "序号: 243\n",
      "电影名称: 大红灯笼高高挂\n",
      "评分: 8.8\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/1293323/\n",
      "\n",
      "\n",
      "序号: 244\n",
      "电影名称: 蜘蛛侠：平行宇宙\n",
      "评分: 8.6\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/26374197/\n",
      "\n",
      "\n",
      "序号: 245\n",
      "电影名称: 弱点\n",
      "评分: 8.7\n",
      "推荐语: 拍掉身上的悲伤，从今天开始重新踏上追梦之旅。\n",
      "链接: https://movie.douban.com/subject/3552028/\n",
      "\n",
      "\n",
      "序号: 246\n",
      "电影名称: 谍影重重\n",
      "评分: 8.6\n",
      "推荐语: 哗啦啦啦啦，天在下雨，哗啦啦啦啦，云在哭泣……找自己。\n",
      "链接: https://movie.douban.com/subject/1304102/\n",
      "\n",
      "\n",
      "序号: 247\n",
      "电影名称: 阿飞正传\n",
      "评分: 8.5\n",
      "推荐语: 王家卫是一种风格，张国荣是一个代表。\n",
      "链接: https://movie.douban.com/subject/1305690/\n",
      "\n",
      "\n",
      "序号: 248\n",
      "电影名称: 朗读者\n",
      "评分: 8.6\n",
      "推荐语: 当爱情跨越年龄的界限，它似乎能变得更久远一点，成为一种责任，一种水到渠成的相濡以沫。\n",
      "链接: https://movie.douban.com/subject/2213597/\n",
      "\n",
      "\n",
      "序号: 249\n",
      "电影名称: 再次出发之纽约遇见你\n",
      "评分: 8.6\n",
      "推荐语: 爱我就给我看你的播放列表。\n",
      "链接: https://movie.douban.com/subject/6874403/\n",
      "\n",
      "\n",
      "序号: 250\n",
      "电影名称: 隐藏人物\n",
      "评分: 8.9\n",
      "推荐语: 暂无推荐语\n",
      "链接: https://movie.douban.com/subject/26615208/\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "from bs4 import BeautifulSoup\n",
    "class MovieInfo:\n",
    "    def __init__(self,rank: str,name: str,rating: float,quote: str,movie_url: str):\n",
    "        self.rank: str = str(rank)\n",
    "        self.name: str = str(name)\n",
    "        self.rating: float = float(rating)\n",
    "        self.quote: str = str(quote)\n",
    "        self.movie_url: str =str(movie_url)\n",
    "header = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0'}\n",
    "\n",
    "movies_info:[MovieInfo] = []\n",
    "\n",
    "# 每页25个个元素 总共10页\n",
    "for i in range(0,250,25):\n",
    "    # Step 1: 获取数据\n",
    "    url = f'https://movie.douban.com/top250?start={i}&filter='\n",
    "    \n",
    "    response = requests.get(url,headers=header)\n",
    "    html_content = response.text\n",
    "    \n",
    "    # Step 2: 使用BeautifulSoup解析\n",
    "    soup = BeautifulSoup(html_content, 'html.parser')\n",
    "    \n",
    "    # Step 3: 提取最小父级标签 \n",
    "    # 这里应该是item而不是info\n",
    "    # 因为class为info的节点中没有影片的序号信息 \n",
    "    # 序号在class为item的div的另一个子节点下\n",
    "    # 而class为item的div包含了所需的全部内容\n",
    "    movie_items = soup.find_all('div', class_='item')\n",
    "    \n",
    "    success = False\n",
    "    \n",
    "    try:\n",
    "        # Step 4: 提取一组信息\n",
    "        movie_item = movie_items[0]\n",
    "        success = True\n",
    "    except:\n",
    "        print('提取信息失败')\n",
    "        continue\n",
    "    \n",
    "    # Step 5: 循环提取所有信息\n",
    "    for movie_item in movie_items:\n",
    "        # 电影序号\n",
    "        rank = movie_item.find('em').text.strip()\n",
    "        \n",
    "        # 电影名称\n",
    "        name = movie_item.find('span', class_='title').text.strip()\n",
    "        \n",
    "        # 评分\n",
    "        rating = movie_item.find('span', class_='rating_num').text.strip()\n",
    "        \n",
    "        # 推荐语\n",
    "        quote = movie_item.find('span', class_='inq')\n",
    "        quote_text = quote.text.strip() if quote else \"暂无推荐语\"\n",
    "        \n",
    "        # 电影链接\n",
    "        movie_url = movie_item.find('a')['href']\n",
    "        movie_info:MovieInfo = MovieInfo(rank,name,rating,quote_text,movie_url)\n",
    "        movies_info.append(movie_info)\n",
    "        \n",
    "        \n",
    "        \n",
    "# 打印结果\n",
    "for movie_info in movies_info:\n",
    "    print(\"序号:\", movie_info.rank)\n",
    "    print(\"电影名称:\", movie_info.name)\n",
    "    print(\"评分:\", movie_info.rating)\n",
    "    print(\"推荐语:\", movie_info.quote)\n",
    "    print(\"链接:\", movie_info.movie_url)\n",
    "    print(\"\\n\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "17582897ea54e2b1",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "\n",
    "\n",
    "【实验8-5】目标：网易云音乐或者酷狗音乐或者QQ音乐平台爬取音乐评论\n",
    "\n",
    "(1)查找并赋值请求头headers\n",
    "(2)查找评论内容、用户名、评论的时间\n",
    "(3)将载荷中的表单内容赋值给params\n",
    "(4)实验操作可以借鉴学习网址：\n",
    "python爬取网易云音乐评论：https://www.jianshu.com/p/94252ab4fbf5\n",
    "(5)将爬取的评论输出"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "id": "5dbf402b5bca1d03",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-05-05T14:15:31.802526900Z",
     "start_time": "2024-05-05T14:15:29.481689900Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "正在爬取第1页评论...\n",
      "正在爬取第2页评论...\n",
      "正在爬取第3页评论...\n",
      "共爬取到37条评论\n",
      "用户名: 林间有翼\n",
      "评论时间: 2024-04-25 12:59:19\n",
      "评论内容: 帅死了\n",
      "----------------------\n",
      "用户名: 云村村民168812209900373\n",
      "评论时间: 2024-03-09 16:32:22\n",
      "评论内容: 我爱你 tika好帅\n",
      "----------------------\n",
      "用户名: 夏小亻韦\n",
      "评论时间: 2024-03-07 11:09:03\n",
      "评论内容: 屌[多多耍酷]\n",
      "----------------------\n",
      "用户名: 笑天_sky\n",
      "评论时间: 2024-03-02 22:18:12\n",
      "评论内容: 凭什么不火？！\n",
      "----------------------\n",
      "用户名: 破晓枫山路\n",
      "评论时间: 2024-02-22 20:32:19\n",
      "评论内容: 哥们你的也够顶的[大哭]\n",
      "----------------------\n",
      "用户名: 不会安装\n",
      "评论时间: 2024-02-19 15:22:10\n",
      "评论内容: 在椅子上起飞的感觉你们知道吗！[外星][外星][外星][外星]\n",
      "----------------------\n",
      "用户名: FrutadelaPasion\n",
      "评论时间: 2024-02-14 17:16:10\n",
      "评论内容: 太好了嗎\n",
      "----------------------\n",
      "用户名: Maojea\n",
      "评论时间: 2024-02-09 20:55:55\n",
      "评论内容: 节奏感十足，嗨起来喽～感觉自己已经在高速上疯狂飙车\n",
      "----------------------\n",
      "用户名: 还怜_\n",
      "评论时间: 2024-02-08 14:34:22\n",
      "评论内容: 太帅了\n",
      "----------------------\n",
      "用户名: 7物极必反\n",
      "评论时间: 2024-02-08 14:33:12\n",
      "评论内容: 来了[爱心]\n",
      "----------------------\n",
      "用户名: jaevon_退网版\n",
      "评论时间: 2024-02-08 14:08:45\n",
      "评论内容: 是好听的\n",
      "----------------------\n",
      "用户名: Fukerz\n",
      "评论时间: 2024-02-08 13:57:22\n",
      "评论内容: 挺顶的\n",
      "----------------------\n",
      "用户名: 梦回千百年\n",
      "评论时间: 2024-02-08 13:56:48\n",
      "评论内容: 终于等到你\n",
      "----------------------\n",
      "用户名: 烈雨\n",
      "评论时间: 2024-02-08 13:56:31\n",
      "评论内容: 顶！[爱心]\n",
      "----------------------\n",
      "用户名: 云村小智障\n",
      "评论时间: 2024-02-08 13:54:35\n",
      "评论内容: 来了\n",
      "----------------------\n",
      "用户名: 川川MASTER\n",
      "评论时间: 2024-02-08 13:48:27\n",
      "评论内容: 很顶就是说！！！🔥🖐🏿\n",
      "----------------------\n",
      "用户名: -昙明-\n",
      "评论时间: 2024-02-08 13:48:02\n",
      "评论内容: 来了\n",
      "----------------------\n",
      "用户名: 杂食之人\n",
      "评论时间: 2024-02-08 13:46:44\n",
      "评论内容: 来!\n",
      "----------------------\n",
      "用户名: __vvwwxfi\n",
      "评论时间: 2024-02-07 15:09:47\n",
      "评论内容: 后面太帅了，反拍嘛，还带了点jersey club\n",
      "----------------------\n",
      "用户名: RMB_Music\n",
      "评论时间: 2024-02-01 15:51:01\n",
      "评论内容: 太顶啦🔥\n",
      "----------------------\n",
      "用户名: TTTTTiANNNNN\n",
      "评论时间: 2024-01-27 09:13:36\n",
      "评论内容: 帅啊\n",
      "----------------------\n",
      "用户名: Alltika\n",
      "评论时间: 2024-01-27 03:43:35\n",
      "评论内容: 希望大家能喜欢我与ONLY GAIN的新单曲\n",
      "----------------------\n",
      "用户名: Alltika\n",
      "评论时间: 2024-01-27 03:38:36\n",
      "评论内容: 可以的 你出现了\n",
      "\n",
      "----------------------\n",
      "用户名: c4onthetrack\n",
      "评论时间: 2024-01-27 03:37:01\n",
      "评论内容: nb有点东西\n",
      "\n",
      "----------------------\n",
      "用户名: 貓貓騎劫隱形戰機_\n",
      "评论时间: 2024-01-27 02:40:53\n",
      "评论内容: 书记 🚬\n",
      "----------------------\n",
      "用户名: 貓貓騎劫隱形戰機_\n",
      "评论时间: 2024-01-27 02:39:48\n",
      "评论内容: 爽吃\n",
      "----------------------\n",
      "用户名: Alltika\n",
      "评论时间: 2024-01-26 23:15:01\n",
      "评论内容: LETS GO RMB！！！\n",
      "----------------------\n",
      "用户名: Ligma-\n",
      "评论时间: 2024-01-26 22:30:16\n",
      "评论内容: LETS GO ONLYGAIN ALLTIKA 🔥🔥🔥\n",
      "----------------------\n",
      "用户名: ZangHeRo\n",
      "评论时间: 2024-01-26 15:42:45\n",
      "评论内容: 这第一个drop太爽了\n",
      "----------------------\n",
      "用户名: b1rtl-l79_M8rE7R4\n",
      "评论时间: 2024-01-26 14:56:00\n",
      "评论内容: yellow claw在电子音乐圈辗转多年也算有所成就了 自己运营的厂牌能让书记过来亲自发行作品了\n",
      "----------------------\n",
      "用户名: AdrienMatsumoto\n",
      "评论时间: 2024-01-26 14:49:59\n",
      "评论内容: buildup太强了\n",
      "----------------------\n",
      "用户名: bierejiejie\n",
      "评论时间: 2024-01-26 08:56:52\n",
      "评论内容: 是trap吗\n",
      "----------------------\n",
      "用户名: ARK1D\n",
      "评论时间: 2024-01-26 07:24:34\n",
      "评论内容:  ONLY GAIN !\n",
      "----------------------\n",
      "用户名: Alltika\n",
      "评论时间: 2024-01-26 03:39:55\n",
      "评论内容: 6\n",
      "\n",
      "----------------------\n",
      "用户名: 貓貓騎劫隱形戰機_\n",
      "评论时间: 2024-01-26 02:35:50\n",
      "评论内容: 叫黃爪過來給書記點煙\n",
      "----------------------\n",
      "用户名: Seny-V\n",
      "评论时间: 2024-01-26 01:55:47\n",
      "评论内容: 来呀\n",
      "----------------------\n",
      "用户名: PlayerArt3mis\n",
      "评论时间: 2024-01-26 01:34:27\n",
      "评论内容: alltika冲鸭\n",
      "----------------------\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "import json\n",
    "import time\n",
    "\n",
    "# 请求头\n",
    "headers = {\n",
    "    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0',\n",
    "    'Referer': 'https://music.163.com/',\n",
    "    'Host': 'music.163.com'\n",
    "}\n",
    "\n",
    "# 获取评论\n",
    "def get_comments(song_id, page=1):\n",
    "    url = 'https://music.163.com/api/v1/resource/comments/R_SO_4_{}?limit=20&offset={}'.format(song_id, (page-1)*20)\n",
    "    params = {\n",
    "        'rid': 'R_SO_4_{}'.format(song_id),\n",
    "        'threadId': 'R_SO_4_{}'.format(song_id),\n",
    "        'offset': (page-1)*20,\n",
    "        'limit': 20,\n",
    "        'csrf_token': ''\n",
    "    }\n",
    "    response = requests.get(url, headers=headers, params=params)\n",
    "    data = json.loads(response.text)\n",
    "    comments = data['comments']\n",
    "    return comments\n",
    "\n",
    "# 解析评论\n",
    "def parse_comments(comments):\n",
    "    parsed_comments = []\n",
    "    for comment in comments:\n",
    "        content = comment['content']\n",
    "        nickname = comment['user']['nickname']\n",
    "        comment_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(comment['time']/1000))\n",
    "        parsed_comments.append({\n",
    "            'nickname': nickname,\n",
    "            'content': content,\n",
    "            'time': comment_time\n",
    "        })\n",
    "    return parsed_comments\n",
    "\n",
    "# 主函数\n",
    "def main(song_id):\n",
    "    comments = []\n",
    "    page = 1\n",
    "    while True:\n",
    "        print('正在爬取第{}页评论...'.format(page))\n",
    "        current_comments = get_comments(song_id, page)\n",
    "        if not current_comments:\n",
    "            break\n",
    "        parsed_comments = parse_comments(current_comments)\n",
    "        comments.extend(parsed_comments)\n",
    "        page += 1\n",
    "    \n",
    "    print('共爬取到{}条评论'.format(len(comments)))\n",
    "    for comment in comments:\n",
    "        print('用户名:', comment['nickname'])\n",
    "        print('评论时间:', comment['time'])\n",
    "        print('评论内容:', comment['content'])\n",
    "        print('----------------------')\n",
    "\n",
    "if __name__ == \"__main__\":\n",
    "    song_id = input(\"请输入歌曲ID(可通过网易云歌曲网站链接末尾查看)：\")\n",
    "    main(song_id)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4bbb9e3ef6201292",
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
